//
//  HYSettingHeadView.m
//  XPlayer
//
//  Created by 张水 on 2023/9/11.
//

#import "HYSettingHeadView.h"
#import "Masonry.h"

@interface HYSettingHeadView ()

@property (nonatomic, strong) UILabel *label;

@end

@implementation HYSettingHeadView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    if(self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self congfigUI];
    }
    return self;
}
- (void)congfigUI
{
    self.contentView.backgroundColor = AppBgThemeColor;
    [self.contentView addSubview:self.label];
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kLeftMargin_15);
        make.right.mas_equalTo(-kLeftMargin_15);
        make.centerY.equalTo(self.contentView);
        make.height.mas_equalTo(20);
    }];
}
- (void)setHeadTitle:(NSString *)title withTextAlignment:(NSTextAlignment)alignment{
    _label.textAlignment = alignment;
    _label.text = title;
}

- (UILabel *)label {
    if( _label == nil ){
        _label = [[UILabel alloc]init];
        _label.font = FONT_BOLD_SIZE(14);
        _label.textColor = UIColor.systemGrayColor;
    }
    return _label;
}
@end
